package com.by.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * description:
 * author:zcx
 * lenovo
 * 时间：2022.06.07.17.26
 */
@RestController
@RequestMapping("/order")
public class OrderController {
    @Autowired
    RestTemplate restTemplate;
    @GetMapping("/save")
    public String save() throws InterruptedException {
        //Thread.sleep(10000);
        System.out.println("--------保存订单----");
     String rs= restTemplate.getForObject("http://ERP-STOCK/stock/update",String.class);
        System.out.println("更新库存结构"+rs);
      return "订单保存成功";
    }

}
